package com.svse.designPattern.behaviour.observer.impl;

import java.util.Observable;
import java.util.Observer;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/8/8 12:05
 */
public class China implements Observer {
    @Override
    public void update(Observable o,Object arg) {
        Float price=((Float)arg).floatValue();
        if(price>0){
            System.out.println("油价上涨"+price+"元，中国伤心了！");
        } else{
            System.out.println("油价下跌"+(-price)+"元，中国高兴了！");
        }
    }
}
